/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1646035071193_948';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  // post请求关闭防火墙
  config.security = {
    csrf: {
      enable: false,
    },
  };

  // 配置mysql
  config.mysql = {
    client: {
      host: 'localhost', // 数据库的域名
      port: 3306, // 数据库的端口号
      user: 'root', // 数据库的用户名称
      password: 'snmsung520', // 数据库的密码
      database: '1908aday8', // 数据库名称
    },
  };

  // 开启post文件文件识别
  config.multipart = {
    mode: 'file',
  };

  return {
    ...config,
    ...userConfig,
  };
};
